Xbasic

UNIQUE_KEY_VALUE Function

Syntax

Logical Result_Flag = UNIQUE_KEY_VALUE()

Description

When used in a filter expression, return only unique values for key.

Discussion

The UNIQUE_KEY_VALUE() function is a special function that returns .T. (TRUE). Its sole purpose is for use in a filter expression where you want to return only those records with unique key values that satisfy the filter expression. Note : Using the UNIQUE_KEY_VALUE() function in a query filter is equivalent to selecting "U" for the query.options flag when using the <TBL>.QUERY_CREATE()method. The advantage of this function over setting the appropriate flag in query.options is that many Alpha Anywhere methods and functions prompt for a filter, but do not let you specify query options.

Example

This will produce a report showing all type 'A' customers sorted by state:

report.preview("customer", "type = 'A' ", "state")

This will produce a report showing the first type 'A' customer in each state:

report.preview("customer", "type = 'A' .and. unique_key_value() ", "state")

See Also